from django.db import models


# Create your models here.


class Hello(models.Model):
    title = models.CharField(max_length=100, verbose_name='标题')
    content = models.TextField(verbose_name='日记信息')
    create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')
    praise = models.IntegerField(verbose_name='点赞数', null=True)
    user = models.ForeignKey(
        to='user.User',
        on_delete=models.CASCADE,
        verbose_name='用户'
    )

    class Meta:
        db_table = 'tb_hello'
        verbose_name = '日志表'


class Essay(models.Model):
    title = models.CharField(max_length=100, verbose_name='标题')
    content = models.TextField(verbose_name='内容')
    create_time = models.DateTimeField(auto_now_add=True, verbose_name='创建时间')

    class Meta:
        db_table = 'tb_essay'
        verbose_name = '文章表'
